home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
index.arc
/
AEBITPRV.BAS
< prev
next >
Wrap
BASIC Source File
|
1987-01-21
|
1KB
|
63 lines
rem $linesize:132
rem $title:'Application Engineer Standard Routines'
rem $subtitle:'Find the PREVIOUS key in lexical sequence'
'
' bit.prev finds the previous key to the currently selected one.
'
' amend it to just loop on the end. 21-Jan-86
'
' Include the COMMON values
rem $include:'AESHARED.BAS'
sub bit.prev(fl%,ky$,mrec%,success%) static
pmrec%=mrec%
psuccess%=success%
pky$=ky$
if success%=0 then
goto noprev
end if
get #fl%,success%
ky$=xk$(fl%,1)
lft%=cvi(xk$(fl%,2))
if lft%=0 then
goto phead
end if
success%=lft%
prnxt:
get #fl%,success%
rgt%=cvi(xk$(fl%,3))
if rgt%=0 then
goto pread
end if
success%=rgt%
goto prnxt
phead:
success%=cvi(xk$(fl%,4))
if success%=0 then
goto noprev
end if
get #fl%,success%
if ky$=>xk$(fl%,1) then
goto pread
end if
goto phead
pread:
ky$=xk$(fl%,1)
mrec%=cvi(xk$(fl%,5))
goto pfin
noprev:
mrec%=0
success%=0
ky$=""
pfin:
if mrec%=0% or success%=0% then
if pmrec%>0% and psuccess%>0% then
mrec%=pmrec%
success%=psuccess%
ky$=pky$
end if
end if
end sub